import request from '@/utils/request'

// 登录方法
export function login(userName, password, code, uuid, platId) {
  /*
  const data = {
    userName: userName,
    password: password,
	platId: 1
  }
  alert("userName:" + data.userName);
  alert("password:" + data.password);
  alert("platId:" + data.platId);
  */
  const data = new FormData();
  data.append('userName',userName);
  data.append('password',password);
  data.append('platId',1);
  return request({
    //url: '/login',
	url: '/platform/login',
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/system-auth/oauth/logout',
    method: 'post',
    maxRedirects: 0,
    followRedirect:false
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    method: 'get'
  })
}